# build
FROM node:latest as builder

WORKDIR /home/ubuntu/gintify/web/
COPY . .

RUN npm i -g yarn --registry https://registry.npm.taobao.org  \
    && yarn install --registry https://registry.npm.taobao.org \
    && yarn build

# product
FROM abiosoft/caddy

COPY --from=builder /home/ubuntu/gintify/web/dist /www
COPY Caddyfile /etc/Caddyfile